<script setup>
import {
    Check,
    Delete,
    Edit,
    Message,
    Search,
    Star,
} from '@element-plus/icons-vue'

import {computed,defineProps} from "vue";
import {formsOutCssMapping} from "@/components/constants";
let theProps = defineProps(["label"])

const styleObject = computed(() =>{
    let formPart = theProps.label.substring(0,theProps.label.lastIndexOf('.'));
    let theForm = formsOutCssMapping[formPart];
    return {"--color-default":`var(--color-`+theForm+`)`,
        "--color-default-bg-color":`var(--color-`+theForm+`-bg-color)`,
        "--color-default-clickdarker":`var(--color-`+theForm+`-clickdarker)`,
        "--color-default-bg-color-editing":`var(--color-`+theForm+`-bg-color-editing)`,
    }
})

</script>

<template>
    <el-row class="mb-4">
        <el-button>Default</el-button>
        <el-button type="primary" class="formsCountBtn" :style="styleObject">Primary</el-button>
<!--        <el-button type="success">Success</el-button>-->
<!--        <el-button type="info">Info</el-button>-->
<!--        <el-button type="warning">Warning</el-button>-->
<!--        <el-button type="danger">Danger</el-button>-->
    </el-row>

<!--    <el-row class="mb-4">-->
<!--        <el-button plain>Plain</el-button>-->
<!--        <el-button type="primary" plain>Primary</el-button>-->
<!--        <el-button type="success" plain>Success</el-button>-->
<!--        <el-button type="info" plain>Info</el-button>-->
<!--        <el-button type="warning" plain>Warning</el-button>-->
<!--        <el-button type="danger" plain>Danger</el-button>-->
<!--    </el-row>-->

<!--    <el-row class="mb-4">-->
<!--        <el-button round>Round</el-button>-->
<!--        <el-button type="primary" round>Primary</el-button>-->
<!--        <el-button type="success" round>Success</el-button>-->
<!--        <el-button type="info" round>Info</el-button>-->
<!--        <el-button type="warning" round>Warning</el-button>-->
<!--        <el-button type="danger" round>Danger</el-button>-->
<!--    </el-row>-->

<!--    <el-row>-->
<!--        <el-button :icon="Search" circle />-->
<!--        <el-button type="primary" :icon="Edit" circle />-->
<!--        <el-button type="success" :icon="Check" circle />-->
<!--        <el-button type="info" :icon="Message" circle />-->
<!--        <el-button type="warning" :icon="Star" circle />-->
<!--        <el-button type="danger" :icon="Delete" circle />-->
<!--    </el-row>-->
</template>

<style scoped>
.el-button.formsCountBtn{

    margin-top: 5px;
    padding:3px 10px;
    height: var(--common-tag-height);
    --el-button-text-color: var(--el-color-white);
    --el-button-bg-color: var(--color-default);
    --el-button-border-color: var(--color-default);
    --el-button-outline-color: var(--color-default-bg-color);
    --el-button-active-color: var(--color-default-clickdarker);
    --el-button-hover-text-color: var(--el-color-white);
    --el-button-hover-link-text-color: var(--color-default-bg-color);
    --el-button-hover-bg-color: var(--color-default-bg-color-editing);
    --el-button-hover-border-color: var(--color-default-bg-color-editing);
    --el-button-active-bg-color: var(--color-default-clickdarker);
    --el-button-active-border-color: var(--color-default-clickdarker);
    --el-button-disabled-text-color: var(--el-color-white);
    --el-button-disabled-bg-color: var(--color-default-bg-color);
    --el-button-disabled-border-color: var(--color-default-bg-color);
    /*background-color: var(--el-button-bg-color);*/
    /*border-color: var(--el-button-border-color);*/
}
</style>